package com.dcy.znoa.common.enums;

/**
 * Created by pengyu on 2017/10/6.
 */
public enum EstateServiceType {
    /**
     * 服务类型：1 报修 2 保洁 3 送水
     */
    REPAIR(1, "报修"),
    CLEAN(2, "保洁"),
    WATER_SUPPLY(3, "送水");

    private Integer code;
    private String msg;

    private EstateServiceType(Integer code, String msg) {
        this.code = code;
        this.msg = msg;
    }

    public static EstateServiceType getMsgByCode(Integer code) {
        if(code==null){return null;}
        switch (code.intValue()) {
            case 1:
                return REPAIR;
            case 2:
                return CLEAN;
            case 3:
                return WATER_SUPPLY;
            default:
                return null;
        }
    }

    public Integer getCode() {
        return code;
    }

    public void setCode(Integer code) {
        this.code = code;
    }

    public String getMsg() {
        return msg;
    }

    public void setMsg(String msg) {
        this.msg = msg;
    }

    public static  void main(String args[]){
        System.out.println(getMsgByCode(2));

    }

}

